<?php
/**
*Smarty plugin to access the i18n interface.
*@package Html
*@author Willy Gardiol <willy@gardiol.org>
*@version 1.0
*@todo Add check for type validity. Eventually, add check for cross-site scripting and such
*@subpackage Smarty
*/
function smarty_function_addScript($params, &$smarty)
{
	$type = isset( $params["type"] ) ? $params["type"] : "invalid_type";
	$plugin = isset( $params["plugin"] )  ? $params["plugin"] : "invalid_plugin";
	$script = isset( $params["script"] )  ? $params["script"] : "invalid";
	$path = "Engine/plugins/$type/$plugin/$script";
	return '<script type="text/javascript" src="'.$path.'" />';
}
?>